includes:
    - /composer/vendor/phpstan/phpstan-webmozart-assert/extension.neon
    - /composer/vendor/phpstan/phpstan-php-parser/extension.neon

parameters:
    checkGenericClassInNonGenericObjectType: false
    level: max
    ignoreErrors:

        - '#Method phpDocumentor\\Reflection\\File\\LocalFile::\md5\(\) should return string but returns string\|false\.#'
        - '#Else branch is unreachable because ternary operator condition is always true\.#'
        #
        # all these $fqsen errors indicate the need for a decorator class around PhpParser\Node to hold the public $fqsen that Reflection is giving it)
        #
        # src/phpDocumentor/Reflection/NodeVisitor/ElementNameResolver.php
        - '#Access to an undefined property PhpParser\\Node\\Stmt\\Class_\|PhpParser\\Node\\Stmt\\Interface_\|PhpParser\\Node\\Stmt\\Trait_::\$fqsen#'
        - '#Access to an undefined property PhpParser\\Node\\Stmt\\Namespace_::\$fqsen\.#'
        - '#Access to an undefined property PhpParser\\Node\\Stmt\\Interface_::\$fqsen\.#'
        - '#Access to an undefined property PhpParser\\Node\\Stmt\\Function_::\$fqsen\.#'
        - '#Access to an undefined property PhpParser\\Node\\Stmt\\ClassMethod::\$fqsen\.#'
        - '#Access to an undefined property PhpParser\\Node\\Const_::\$fqsen\.#'
        - '#Access to an undefined property PhpParser\\Node\\Stmt\\PropertyProperty::\$fqsen\.#'
        #
        # src/phpDocumentor/Reflection/Php/Factory/Class_.php
        - '#Access to an undefined property PhpParser\\Node\\Stmt\\Class_::\$fqsen\.#'
        #
        # src/phpDocumentor/Reflection/Php/Factory/Trait_.php
        - '#Access to an undefined property PhpParser\\Node\\Stmt\\Trait_::\$fqsen\.#'
        #
        #
        # this is a mismatch inside php-parser, not reflection
        - '#Parameter \#1 \$nodes of method PhpParser\\NodeTraverser::traverse\(\) expects array\<PhpParser\\Node>, array\<PhpParser\\Node\\Stmt\>\|null given\.#'
        #
        #
        # there is one test case that prevents changing PropertyIterator::getDefault() to just return Expr (this is set in PhpParser)
        # src/phpDocumentor/Reflection/Php/Factory/Property.php
        - '#Parameter \#1 \$node of method PhpParser\\PrettyPrinterAbstract::prettyPrintExpr\(\) expects PhpParser\\Node\\Expr, PhpParser\\Node\\Expr\|string given\.#'
        #
        # Type hint in php-parser is incorrect.
        - '#Cannot cast PhpParser\\Node\\Expr\|string to string.#'
        #
        # until I can make $object arg ?$object...
        # src/phpDocumentor/Reflection/Php/Factory/DocBlock.php
        - '#Strict comparison using === between PhpParser\\Comment\\Doc and null will always evaluate to false\.#'

        -
                message: "#^Parameter \\#1 \\$constant of method phpDocumentor\\\\Reflection\\\\Php\\\\File\\:\\:addConstant\\(\\) expects phpDocumentor\\\\Reflection\\\\Php\\\\Constant, phpDocumentor\\\\Reflection\\\\DocBlock\\|phpDocumentor\\\\Reflection\\\\Element\\|phpDocumentor\\\\Reflection\\\\Php\\\\Argument\\|phpDocumentor\\\\Reflection\\\\Php\\\\File\\|null given\\.$#"
                count: 2
                path: src/phpDocumentor/Reflection/Php/Factory/File.php

        -
                message: "#^Parameter \\#1 \\$class of method phpDocumentor\\\\Reflection\\\\Php\\\\File\\:\\:addClass\\(\\) expects phpDocumentor\\\\Reflection\\\\Php\\\\Class_, phpDocumentor\\\\Reflection\\\\DocBlock\\|phpDocumentor\\\\Reflection\\\\Element\\|phpDocumentor\\\\Reflection\\\\Php\\\\Argument\\|phpDocumentor\\\\Reflection\\\\Php\\\\File\\|null given\\.$#"
                count: 1
                path: src/phpDocumentor/Reflection/Php/Factory/File.php

        -
                message: "#^Parameter \\#1 \\$function of method phpDocumentor\\\\Reflection\\\\Php\\\\File\\:\\:addFunction\\(\\) expects phpDocumentor\\\\Reflection\\\\Php\\\\Function_, phpDocumentor\\\\Reflection\\\\DocBlock\\|phpDocumentor\\\\Reflection\\\\Element\\|phpDocumentor\\\\Reflection\\\\Php\\\\Argument\\|phpDocumentor\\\\Reflection\\\\Php\\\\File\\|null given\\.$#"
                count: 1
                path: src/phpDocumentor/Reflection/Php/Factory/File.php

        -
                message: "#^Parameter \\#1 \\$interface of method phpDocumentor\\\\Reflection\\\\Php\\\\File\\:\\:addInterface\\(\\) expects phpDocumentor\\\\Reflection\\\\Php\\\\Interface_, phpDocumentor\\\\Reflection\\\\DocBlock\\|phpDocumentor\\\\Reflection\\\\Element\\|phpDocumentor\\\\Reflection\\\\Php\\\\Argument\\|phpDocumentor\\\\Reflection\\\\Php\\\\File\\|null given\\.$#"
                count: 1
                path: src/phpDocumentor/Reflection/Php/Factory/File.php

        -
                message: "#^Parameter \\#1 \\$trait of method phpDocumentor\\\\Reflection\\\\Php\\\\File\\:\\:addTrait\\(\\) expects phpDocumentor\\\\Reflection\\\\Php\\\\Trait_, phpDocumentor\\\\Reflection\\\\DocBlock\\|phpDocumentor\\\\Reflection\\\\Element\\|phpDocumentor\\\\Reflection\\\\Php\\\\Argument\\|phpDocumentor\\\\Reflection\\\\Php\\\\File\\|null given\\.$#"
                count: 1
                path: src/phpDocumentor/Reflection/Php/Factory/File.php

        -
                message: "#^Parameter \\#1 \\$argument of method phpDocumentor\\\\Reflection\\\\Php\\\\Function_\\:\\:addArgument\\(\\) expects phpDocumentor\\\\Reflection\\\\Php\\\\Argument, phpDocumentor\\\\Reflection\\\\DocBlock\\|phpDocumentor\\\\Reflection\\\\Element\\|phpDocumentor\\\\Reflection\\\\Php\\\\Argument\\|phpDocumentor\\\\Reflection\\\\Php\\\\File\\|null given\\.$#"
                count: 1
                path: src/phpDocumentor/Reflection/Php/Factory/Function_.php
